package com.mob.tools.network;

import android.content.Context;
import android.os.Build.VERSION;
import com.mob.tools.MobLog;
import com.mob.tools.log.NLog;
import com.mob.tools.utils.Data;
import com.mob.tools.utils.Hashon;
import com.mob.tools.utils.R;
import com.mob.tools.utils.ReflectHelper;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.FileNameMap;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.Charset;
import java.security.KeyStore;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.UUID;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
import org.apache.http.HttpResponse;
import org.apache.http.HttpVersion;
import org.apache.http.client.HttpClient;
import org.apache.http.conn.ClientConnectionManager;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.conn.ssl.X509HostnameVerifier;
import org.apache.http.entity.InputStreamEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpProtocolParams;

public class NetworkHelper
{
  public static int connectionTimeout;
  public static int readTimout;

  private HttpURLConnection getConnection(String paramString, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    HttpURLConnection localHttpURLConnection = (HttpURLConnection)new URL(paramString).openConnection();
    String str = "methodTokens";
    if (0 != 0);
    try
    {
      Object localObject7 = ReflectHelper.getStaticField("HttpURLConnection", str);
      localObject1 = localObject7;
      while (true)
        if (localObject1 == null)
        {
          str = "PERMITTED_USER_METHODS";
          i = 1;
          if (i != 0);
          try
          {
            Object localObject5 = ReflectHelper.getStaticField("HttpURLConnection", str);
            Object localObject3;
            for (Object localObject4 = localObject5; ; localObject4 = localObject3)
            {
              localObject2 = localObject4;
              if (localObject2 != null)
              {
                String[] arrayOfString1 = (String[])localObject2;
                arrayOfString2 = new String[1 + arrayOfString1.length];
                System.arraycopy(arrayOfString1, 0, arrayOfString2, 0, arrayOfString1.length);
                arrayOfString2[arrayOfString1.length] = "PATCH";
                if (i == 0)
                  break label301;
                ReflectHelper.setStaticField("HttpURLConnection", str, arrayOfString2);
              }
              if (Build.VERSION.SDK_INT < 8)
                System.setProperty("http.keepAlive", "false");
              if ((localHttpURLConnection instanceof HttpsURLConnection))
              {
                X509HostnameVerifier localX509HostnameVerifier = SSLSocketFactory.STRICT_HOSTNAME_VERIFIER;
                HttpsURLConnection localHttpsURLConnection = (HttpsURLConnection)localHttpURLConnection;
                SSLContext localSSLContext = SSLContext.getInstance("TLS");
                TrustManager[] arrayOfTrustManager = new TrustManager[1];
                arrayOfTrustManager[0] = new SimpleX509TrustManager(null);
                localSSLContext.init(null, arrayOfTrustManager, new SecureRandom());
                localHttpsURLConnection.setSSLSocketFactory(localSSLContext.getSocketFactory());
                localHttpsURLConnection.setHostnameVerifier(localX509HostnameVerifier);
              }
              if (paramNetworkTimeOut != null)
                break label312;
              j = connectionTimeout;
              if (j > 0)
                localHttpURLConnection.setConnectTimeout(j);
              if (paramNetworkTimeOut != null)
                break label321;
              k = readTimout;
              if (k > 0)
                localHttpURLConnection.setReadTimeout(k);
              return localHttpURLConnection;
              Object localObject6 = ReflectHelper.getInstanceField(localHttpURLConnection, str);
              localObject1 = localObject6;
              break;
              localObject3 = ReflectHelper.getInstanceField(localHttpURLConnection, str);
            }
          }
          catch (Throwable localThrowable2)
          {
            while (true)
            {
              String[] arrayOfString2;
              localObject2 = localObject1;
              continue;
              label301: ReflectHelper.setInstanceField(localHttpURLConnection, str, arrayOfString2);
              continue;
              label312: int j = paramNetworkTimeOut.connectionTimeout;
              continue;
              label321: int k = paramNetworkTimeOut.readTimout;
            }
          }
        }
    }
    catch (Throwable localThrowable1)
    {
      while (true)
      {
        Object localObject1 = null;
        continue;
        Object localObject2 = localObject1;
        int i = 0;
      }
    }
  }

  private HTTPPart getFilePostHTTPPart(HttpURLConnection paramHttpURLConnection, String paramString, ArrayList<KVPair<String>> paramArrayList1, ArrayList<KVPair<String>> paramArrayList2)
    throws Throwable
  {
    String str1 = UUID.randomUUID().toString();
    paramHttpURLConnection.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + str1);
    MultiPart localMultiPart = new MultiPart();
    StringPart localStringPart1 = new StringPart();
    if (paramArrayList1 != null)
    {
      Iterator localIterator2 = paramArrayList1.iterator();
      while (localIterator2.hasNext())
      {
        KVPair localKVPair2 = (KVPair)localIterator2.next();
        localStringPart1.append("--").append(str1).append("\r\n");
        localStringPart1.append("Content-Disposition: form-data; name=\"").append(localKVPair2.name).append("\"\r\n\r\n");
        localStringPart1.append((String)localKVPair2.value).append("\r\n");
      }
    }
    localMultiPart.append(localStringPart1);
    Iterator localIterator1 = paramArrayList2.iterator();
    if (localIterator1.hasNext())
    {
      KVPair localKVPair1 = (KVPair)localIterator1.next();
      StringPart localStringPart3 = new StringPart();
      File localFile = new File((String)localKVPair1.value);
      localStringPart3.append("--").append(str1).append("\r\n");
      localStringPart3.append("Content-Disposition: form-data; name=\"").append(localKVPair1.name).append("\"; filename=\"").append(localFile.getName()).append("\"\r\n");
      String str2 = URLConnection.getFileNameMap().getContentTypeFor((String)localKVPair1.value);
      if ((str2 == null) || (str2.length() <= 0))
      {
        if ((!((String)localKVPair1.value).toLowerCase().endsWith("jpg")) && (!((String)localKVPair1.value).toLowerCase().endsWith("jpeg")))
          break label417;
        str2 = "image/jpeg";
      }
      while (true)
      {
        localStringPart3.append("Content-Type: ").append(str2).append("\r\n\r\n");
        localMultiPart.append(localStringPart3);
        FilePart localFilePart = new FilePart();
        localFilePart.setFile((String)localKVPair1.value);
        localMultiPart.append(localFilePart);
        StringPart localStringPart4 = new StringPart();
        localStringPart4.append("\r\n");
        localMultiPart.append(localStringPart4);
        break;
        label417: if (((String)localKVPair1.value).toLowerCase().endsWith("png"))
        {
          str2 = "image/png";
        }
        else if (((String)localKVPair1.value).toLowerCase().endsWith("gif"))
        {
          str2 = "image/gif";
        }
        else
        {
          FileInputStream localFileInputStream = new FileInputStream((String)localKVPair1.value);
          str2 = URLConnection.guessContentTypeFromStream(localFileInputStream);
          localFileInputStream.close();
          if ((str2 == null) || (str2.length() <= 0))
            str2 = "application/octet-stream";
        }
      }
    }
    StringPart localStringPart2 = new StringPart();
    localStringPart2.append("--").append(str1).append("--\r\n");
    localMultiPart.append(localStringPart2);
    return localMultiPart;
  }

  private HTTPPart getTextPostHTTPPart(HttpURLConnection paramHttpURLConnection, String paramString, ArrayList<KVPair<String>> paramArrayList)
    throws Throwable
  {
    paramHttpURLConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
    StringPart localStringPart = new StringPart();
    if (paramArrayList != null)
      localStringPart.append(kvPairsToUrl(paramArrayList));
    return localStringPart;
  }

  private void httpPatchImpl(String paramString, ArrayList<KVPair<String>> paramArrayList1, KVPair<String> paramKVPair, long paramLong, ArrayList<KVPair<String>> paramArrayList2, OnReadListener paramOnReadListener, HttpResponseCallback paramHttpResponseCallback, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    long l = System.currentTimeMillis();
    MobLog.getInstance().i("httpPatch: " + paramString, new Object[0]);
    if (paramArrayList1 != null)
    {
      String str = kvPairsToUrl(paramArrayList1);
      if (str.length() > 0)
        paramString = paramString + "?" + str;
    }
    HttpPatch localHttpPatch = new HttpPatch(paramString);
    if (paramArrayList2 != null)
    {
      Iterator localIterator = paramArrayList2.iterator();
      while (localIterator.hasNext())
      {
        KVPair localKVPair = (KVPair)localIterator.next();
        localHttpPatch.setHeader(localKVPair.name, (String)localKVPair.value);
      }
    }
    FilePart localFilePart = new FilePart();
    localFilePart.setOnReadListener(paramOnReadListener);
    localFilePart.setFile((String)paramKVPair.value);
    localFilePart.setOffset(paramLong);
    InputStreamEntity localInputStreamEntity = new InputStreamEntity(localFilePart.toInputStream(), localFilePart.length() - paramLong);
    localInputStreamEntity.setContentEncoding("application/offset+octet-stream");
    localHttpPatch.setEntity(localInputStreamEntity);
    BasicHttpParams localBasicHttpParams1 = new BasicHttpParams();
    int i;
    int j;
    label259: DefaultHttpClient localDefaultHttpClient;
    label432: HttpResponse localHttpResponse;
    if (paramNetworkTimeOut == null)
    {
      i = connectionTimeout;
      if (i > 0)
        HttpConnectionParams.setConnectionTimeout(localBasicHttpParams1, i);
      if (paramNetworkTimeOut != null)
        break label527;
      j = readTimout;
      if (j > 0)
        HttpConnectionParams.setSoTimeout(localBasicHttpParams1, j);
      localHttpPatch.setParams(localBasicHttpParams1);
      if (!paramString.startsWith("https://"))
        break label537;
      KeyStore localKeyStore = KeyStore.getInstance(KeyStore.getDefaultType());
      localKeyStore.load(null, null);
      SSLSocketFactoryEx localSSLSocketFactoryEx = new SSLSocketFactoryEx(localKeyStore);
      localSSLSocketFactoryEx.setHostnameVerifier(SSLSocketFactory.STRICT_HOSTNAME_VERIFIER);
      BasicHttpParams localBasicHttpParams2 = new BasicHttpParams();
      HttpProtocolParams.setVersion(localBasicHttpParams2, HttpVersion.HTTP_1_1);
      HttpProtocolParams.setContentCharset(localBasicHttpParams2, "UTF-8");
      SchemeRegistry localSchemeRegistry = new SchemeRegistry();
      PlainSocketFactory localPlainSocketFactory = PlainSocketFactory.getSocketFactory();
      Scheme localScheme1 = new Scheme("http", localPlainSocketFactory, 80);
      localSchemeRegistry.register(localScheme1);
      Scheme localScheme2 = new Scheme("https", localSSLSocketFactoryEx, 443);
      localSchemeRegistry.register(localScheme2);
      localDefaultHttpClient = new DefaultHttpClient(new ThreadSafeClientConnManager(localBasicHttpParams2, localSchemeRegistry), localBasicHttpParams2);
      localHttpResponse = localDefaultHttpClient.execute(localHttpPatch);
      if (paramHttpResponseCallback == null)
        break label571;
    }
    while (true)
    {
      try
      {
        HttpConnectionImpl localHttpConnectionImpl = new HttpConnectionImpl(localHttpResponse);
        paramHttpResponseCallback.onResponse(localHttpConnectionImpl);
        localDefaultHttpClient.getConnectionManager().shutdown();
        MobLog.getInstance().i("use time: " + (System.currentTimeMillis() - l), new Object[0]);
        return;
        i = paramNetworkTimeOut.connectionTimeout;
        break;
        label527: j = paramNetworkTimeOut.readTimout;
        break label259;
        label537: localDefaultHttpClient = new DefaultHttpClient();
        break label432;
      }
      catch (Throwable localThrowable)
      {
        throw localThrowable;
      }
      finally
      {
        localDefaultHttpClient.getConnectionManager().shutdown();
      }
      label571: localDefaultHttpClient.getConnectionManager().shutdown();
    }
  }

  private String kvPairsToUrl(ArrayList<KVPair<String>> paramArrayList)
    throws Throwable
  {
    StringBuilder localStringBuilder = new StringBuilder();
    Iterator localIterator = paramArrayList.iterator();
    if (localIterator.hasNext())
    {
      KVPair localKVPair = (KVPair)localIterator.next();
      String str1 = Data.urlEncode(localKVPair.name, "utf-8");
      if (localKVPair.value != null);
      for (String str2 = Data.urlEncode((String)localKVPair.value, "utf-8"); ; str2 = "")
      {
        if (localStringBuilder.length() > 0)
          localStringBuilder.append('&');
        localStringBuilder.append(str1).append('=').append(str2);
        break;
      }
    }
    return localStringBuilder.toString();
  }

  public String downloadCache(Context paramContext, String paramString1, String paramString2, boolean paramBoolean, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    long l = System.currentTimeMillis();
    MobLog.getInstance().i("downloading: " + paramString1, new Object[0]);
    if (paramBoolean)
    {
      File localFile1 = new File(R.getCachePath(paramContext, paramString2), Data.MD5(paramString1));
      if ((paramBoolean) && (localFile1.exists()))
      {
        MobLog.getInstance().i("use time: " + (System.currentTimeMillis() - l), new Object[0]);
        return localFile1.getAbsolutePath();
      }
    }
    HttpURLConnection localHttpURLConnection = getConnection(paramString1, paramNetworkTimeOut);
    localHttpURLConnection.connect();
    int i = localHttpURLConnection.getResponseCode();
    if (i == 200)
    {
      Map localMap = localHttpURLConnection.getHeaderFields();
      String str2 = null;
      if (localMap != null)
      {
        List localList2 = (List)localMap.get("Content-Disposition");
        str2 = null;
        if (localList2 != null)
        {
          int n = localList2.size();
          str2 = null;
          if (n > 0)
            for (String str7 : ((String)localList2.get(0)).split(";"))
              if (str7.trim().startsWith("filename"))
              {
                str2 = str7.split("=")[1];
                if ((str2.startsWith("\"")) && (str2.endsWith("\"")))
                {
                  int i3 = -1 + str2.length();
                  str2 = str2.substring(1, i3);
                }
              }
        }
      }
      String str3;
      String str4;
      String str6;
      StringBuilder localStringBuilder2;
      if (str2 == null)
      {
        str2 = Data.MD5(paramString1);
        if (localMap != null)
        {
          List localList1 = (List)localMap.get("Content-Type");
          if ((localList1 != null) && (localList1.size() > 0))
          {
            str3 = (String)localList1.get(0);
            if (str3 != null)
              break label526;
            str4 = "";
            if (!str4.startsWith("image/"))
              break label536;
            str6 = str4.substring("image/".length());
            localStringBuilder2 = new StringBuilder().append(str2).append(".");
            if ("jpeg".equals(str6))
              str6 = "jpg";
          }
        }
      }
      File localFile2;
      label526: label536: String str5;
      int m;
      for (str2 = str6; ; str2 = str2 + str5.substring(m))
        do
        {
          do
          {
            localFile2 = new File(R.getCachePath(paramContext, paramString2), str2);
            if ((!paramBoolean) || (!localFile2.exists()))
              break label632;
            localHttpURLConnection.disconnect();
            MobLog.getInstance().i("use time: " + (System.currentTimeMillis() - l), new Object[0]);
            return localFile2.getAbsolutePath();
            str4 = str3.trim();
            break;
            int k = paramString1.lastIndexOf('/');
            str5 = null;
            if (k > 0)
              str5 = paramString1.substring(k + 1);
          }
          while ((str5 == null) || (str5.length() <= 0));
          m = str5.lastIndexOf('.');
        }
        while ((m <= 0) || (str5.length() - m >= 10));
      label632: if (!localFile2.getParentFile().exists())
        localFile2.getParentFile().mkdirs();
      if (localFile2.exists())
        localFile2.delete();
      try
      {
        InputStream localInputStream = localHttpURLConnection.getInputStream();
        FileOutputStream localFileOutputStream = new FileOutputStream(localFile2);
        byte[] arrayOfByte = new byte[1024];
        for (int j = localInputStream.read(arrayOfByte); j > 0; j = localInputStream.read(arrayOfByte))
          localFileOutputStream.write(arrayOfByte, 0, j);
        localFileOutputStream.flush();
        localInputStream.close();
        localFileOutputStream.close();
        localHttpURLConnection.disconnect();
        MobLog.getInstance().i("use time: " + (System.currentTimeMillis() - l), new Object[0]);
        return localFile2.getAbsolutePath();
      }
      catch (Throwable localThrowable)
      {
        if (localFile2.exists())
          localFile2.delete();
        throw localThrowable;
      }
    }
    StringBuilder localStringBuilder1 = new StringBuilder();
    BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(localHttpURLConnection.getErrorStream(), Charset.forName("utf-8")));
    for (String str1 = localBufferedReader.readLine(); str1 != null; str1 = localBufferedReader.readLine())
    {
      if (localStringBuilder1.length() > 0)
        localStringBuilder1.append('\n');
      localStringBuilder1.append(str1);
    }
    localBufferedReader.close();
    localHttpURLConnection.disconnect();
    HashMap localHashMap = new HashMap();
    localHashMap.put("error", localStringBuilder1.toString());
    localHashMap.put("status", Integer.valueOf(i));
    throw new Throwable(new Hashon().fromHashMap(localHashMap));
  }

  public void getHttpPostResponse(String paramString, ArrayList<KVPair<String>> paramArrayList1, KVPair<String> paramKVPair, ArrayList<KVPair<String>> paramArrayList2, HttpResponseCallback paramHttpResponseCallback, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    long l = System.currentTimeMillis();
    MobLog.getInstance().i("httpPost: " + paramString, new Object[0]);
    HttpURLConnection localHttpURLConnection = getConnection(paramString, paramNetworkTimeOut);
    localHttpURLConnection.setDoOutput(true);
    localHttpURLConnection.setChunkedStreamingMode(0);
    ArrayList localArrayList;
    if ((paramKVPair != null) && (paramKVPair.value != null))
    {
      File localFile = new File((String)paramKVPair.value);
      if (localFile.exists())
      {
        localArrayList = new ArrayList();
        localArrayList.add(paramKVPair);
      }
    }
    for (HTTPPart localHTTPPart = getFilePostHTTPPart(localHttpURLConnection, paramString, paramArrayList1, localArrayList); paramArrayList2 != null; localHTTPPart = getTextPostHTTPPart(localHttpURLConnection, paramString, paramArrayList1))
    {
      Iterator localIterator = paramArrayList2.iterator();
      while (localIterator.hasNext())
      {
        KVPair localKVPair = (KVPair)localIterator.next();
        localHttpURLConnection.setRequestProperty(localKVPair.name, (String)localKVPair.value);
      }
    }
    localHttpURLConnection.connect();
    OutputStream localOutputStream = localHttpURLConnection.getOutputStream();
    InputStream localInputStream = localHTTPPart.toInputStream();
    byte[] arrayOfByte = new byte[65536];
    for (int i = localInputStream.read(arrayOfByte); i > 0; i = localInputStream.read(arrayOfByte))
      localOutputStream.write(arrayOfByte, 0, i);
    localOutputStream.flush();
    localInputStream.close();
    localOutputStream.close();
    if (paramHttpResponseCallback != null);
    while (true)
    {
      try
      {
        paramHttpResponseCallback.onResponse(new HttpConnectionImpl23(localHttpURLConnection));
        localHttpURLConnection.disconnect();
        MobLog.getInstance().i("use time: " + (System.currentTimeMillis() - l), new Object[0]);
        return;
      }
      catch (Throwable localThrowable)
      {
        throw localThrowable;
      }
      finally
      {
        localHttpURLConnection.disconnect();
      }
      localHttpURLConnection.disconnect();
    }
  }

  public String httpGet(String paramString, ArrayList<KVPair<String>> paramArrayList1, ArrayList<KVPair<String>> paramArrayList2, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    long l = System.currentTimeMillis();
    MobLog.getInstance().i("httpGet: " + paramString, new Object[0]);
    if (paramArrayList1 != null)
    {
      String str4 = kvPairsToUrl(paramArrayList1);
      if (str4.length() > 0)
        paramString = paramString + "?" + str4;
    }
    HttpURLConnection localHttpURLConnection = getConnection(paramString, paramNetworkTimeOut);
    if (paramArrayList2 != null)
    {
      Iterator localIterator = paramArrayList2.iterator();
      while (localIterator.hasNext())
      {
        KVPair localKVPair = (KVPair)localIterator.next();
        localHttpURLConnection.setRequestProperty(localKVPair.name, (String)localKVPair.value);
      }
    }
    localHttpURLConnection.connect();
    int i = localHttpURLConnection.getResponseCode();
    if (i == 200)
    {
      StringBuilder localStringBuilder1 = new StringBuilder();
      BufferedReader localBufferedReader1 = new BufferedReader(new InputStreamReader(localHttpURLConnection.getInputStream(), Charset.forName("utf-8")));
      for (String str1 = localBufferedReader1.readLine(); str1 != null; str1 = localBufferedReader1.readLine())
      {
        if (localStringBuilder1.length() > 0)
          localStringBuilder1.append('\n');
        localStringBuilder1.append(str1);
      }
      localBufferedReader1.close();
      localHttpURLConnection.disconnect();
      String str2 = localStringBuilder1.toString();
      MobLog.getInstance().i("use time: " + (System.currentTimeMillis() - l), new Object[0]);
      return str2;
    }
    StringBuilder localStringBuilder2 = new StringBuilder();
    BufferedReader localBufferedReader2 = new BufferedReader(new InputStreamReader(localHttpURLConnection.getErrorStream(), Charset.forName("utf-8")));
    for (String str3 = localBufferedReader2.readLine(); str3 != null; str3 = localBufferedReader2.readLine())
    {
      if (localStringBuilder2.length() > 0)
        localStringBuilder2.append('\n');
      localStringBuilder2.append(str3);
    }
    localBufferedReader2.close();
    localHttpURLConnection.disconnect();
    HashMap localHashMap = new HashMap();
    localHashMap.put("error", localStringBuilder2.toString());
    localHashMap.put("status", Integer.valueOf(i));
    throw new Throwable(new Hashon().fromHashMap(localHashMap));
  }

  public ArrayList<KVPair<String[]>> httpHead(String paramString, ArrayList<KVPair<String>> paramArrayList1, KVPair<String> paramKVPair, ArrayList<KVPair<String>> paramArrayList2, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    long l = System.currentTimeMillis();
    MobLog.getInstance().i("httpHead: " + paramString, new Object[0]);
    if (paramArrayList1 != null)
    {
      String str = kvPairsToUrl(paramArrayList1);
      if (str.length() > 0)
        paramString = paramString + "?" + str;
    }
    HttpURLConnection localHttpURLConnection = getConnection(paramString, paramNetworkTimeOut);
    localHttpURLConnection.setRequestMethod("HEAD");
    if (paramArrayList2 != null)
    {
      Iterator localIterator2 = paramArrayList2.iterator();
      while (localIterator2.hasNext())
      {
        KVPair localKVPair3 = (KVPair)localIterator2.next();
        localHttpURLConnection.setRequestProperty(localKVPair3.name, (String)localKVPair3.value);
      }
    }
    localHttpURLConnection.connect();
    Map localMap = localHttpURLConnection.getHeaderFields();
    ArrayList localArrayList = new ArrayList();
    if (localMap != null)
    {
      Iterator localIterator1 = localMap.entrySet().iterator();
      while (localIterator1.hasNext())
      {
        Map.Entry localEntry = (Map.Entry)localIterator1.next();
        List localList = (List)localEntry.getValue();
        if (localList == null)
        {
          KVPair localKVPair1 = new KVPair((String)localEntry.getKey(), new String[0]);
          localArrayList.add(localKVPair1);
        }
        else
        {
          String[] arrayOfString = new String[localList.size()];
          for (int i = 0; i < arrayOfString.length; i++)
            arrayOfString[i] = ((String)localList.get(i));
          KVPair localKVPair2 = new KVPair((String)localEntry.getKey(), arrayOfString);
          localArrayList.add(localKVPair2);
        }
      }
    }
    localHttpURLConnection.disconnect();
    MobLog.getInstance().i("use time: " + (System.currentTimeMillis() - l), new Object[0]);
    return localArrayList;
  }

  public void httpPatch(String paramString, ArrayList<KVPair<String>> paramArrayList1, KVPair<String> paramKVPair, long paramLong, ArrayList<KVPair<String>> paramArrayList2, OnReadListener paramOnReadListener, HttpResponseCallback paramHttpResponseCallback, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    if (Build.VERSION.SDK_INT >= 23)
    {
      httpPatchImpl23(paramString, paramArrayList1, paramKVPair, paramLong, paramArrayList2, paramOnReadListener, paramHttpResponseCallback, paramNetworkTimeOut);
      return;
    }
    httpPatchImpl(paramString, paramArrayList1, paramKVPair, paramLong, paramArrayList2, paramOnReadListener, paramHttpResponseCallback, paramNetworkTimeOut);
  }

  public void httpPatchImpl23(String paramString, ArrayList<KVPair<String>> paramArrayList1, KVPair<String> paramKVPair, long paramLong, ArrayList<KVPair<String>> paramArrayList2, OnReadListener paramOnReadListener, HttpResponseCallback paramHttpResponseCallback, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    long l = System.currentTimeMillis();
    MobLog.getInstance().i("httpPatch: " + paramString, new Object[0]);
    if (paramArrayList1 != null)
    {
      String str = kvPairsToUrl(paramArrayList1);
      if (str.length() > 0)
        paramString = paramString + "?" + str;
    }
    HttpURLConnection localHttpURLConnection = getConnection(paramString, paramNetworkTimeOut);
    localHttpURLConnection.setDoOutput(true);
    localHttpURLConnection.setChunkedStreamingMode(0);
    localHttpURLConnection.setRequestMethod("PATCH");
    localHttpURLConnection.setRequestProperty("Content-Type", "application/offset+octet-stream");
    if (paramArrayList2 != null)
    {
      Iterator localIterator = paramArrayList2.iterator();
      while (localIterator.hasNext())
      {
        KVPair localKVPair = (KVPair)localIterator.next();
        localHttpURLConnection.setRequestProperty(localKVPair.name, (String)localKVPair.value);
      }
    }
    localHttpURLConnection.connect();
    OutputStream localOutputStream = localHttpURLConnection.getOutputStream();
    FilePart localFilePart = new FilePart();
    localFilePart.setOnReadListener(paramOnReadListener);
    localFilePart.setFile((String)paramKVPair.value);
    localFilePart.setOffset(paramLong);
    InputStream localInputStream = localFilePart.toInputStream();
    byte[] arrayOfByte = new byte[65536];
    for (int i = localInputStream.read(arrayOfByte); i > 0; i = localInputStream.read(arrayOfByte))
      localOutputStream.write(arrayOfByte, 0, i);
    localOutputStream.flush();
    localInputStream.close();
    localOutputStream.close();
    if (paramHttpResponseCallback != null);
    while (true)
    {
      try
      {
        paramHttpResponseCallback.onResponse(new HttpConnectionImpl23(localHttpURLConnection));
        localHttpURLConnection.disconnect();
        MobLog.getInstance().i("use time: " + (System.currentTimeMillis() - l), new Object[0]);
        return;
      }
      catch (Throwable localThrowable)
      {
        throw localThrowable;
      }
      finally
      {
        localHttpURLConnection.disconnect();
      }
      localHttpURLConnection.disconnect();
    }
  }

  public String httpPost(String paramString, ArrayList<KVPair<String>> paramArrayList1, KVPair<String> paramKVPair, ArrayList<KVPair<String>> paramArrayList2, int paramInt, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    ArrayList localArrayList = new ArrayList();
    if ((paramKVPair != null) && (paramKVPair.value != null) && (new File((String)paramKVPair.value).exists()))
      localArrayList.add(paramKVPair);
    return httpPostFiles(paramString, paramArrayList1, localArrayList, paramArrayList2, paramInt, paramNetworkTimeOut);
  }

  public String httpPost(String paramString, ArrayList<KVPair<String>> paramArrayList1, KVPair<String> paramKVPair, ArrayList<KVPair<String>> paramArrayList2, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    return httpPost(paramString, paramArrayList1, paramKVPair, paramArrayList2, 0, paramNetworkTimeOut);
  }

  public void httpPost(String paramString, ArrayList<KVPair<String>> paramArrayList1, ArrayList<KVPair<String>> paramArrayList2, ArrayList<KVPair<String>> paramArrayList3, int paramInt, HttpResponseCallback paramHttpResponseCallback, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    long l = System.currentTimeMillis();
    MobLog.getInstance().i("httpPost: " + paramString, new Object[0]);
    HttpURLConnection localHttpURLConnection = getConnection(paramString, paramNetworkTimeOut);
    localHttpURLConnection.setDoOutput(true);
    HTTPPart localHTTPPart;
    if ((paramArrayList2 != null) && (paramArrayList2.size() > 0))
    {
      localHTTPPart = getFilePostHTTPPart(localHttpURLConnection, paramString, paramArrayList1, paramArrayList2);
      if (paramInt >= 0)
        localHttpURLConnection.setChunkedStreamingMode(paramInt);
    }
    while (paramArrayList3 != null)
    {
      Iterator localIterator = paramArrayList3.iterator();
      while (localIterator.hasNext())
      {
        KVPair localKVPair = (KVPair)localIterator.next();
        localHttpURLConnection.setRequestProperty(localKVPair.name, (String)localKVPair.value);
      }
      localHTTPPart = getTextPostHTTPPart(localHttpURLConnection, paramString, paramArrayList1);
      localHttpURLConnection.setFixedLengthStreamingMode((int)localHTTPPart.length());
    }
    localHttpURLConnection.connect();
    OutputStream localOutputStream = localHttpURLConnection.getOutputStream();
    InputStream localInputStream = localHTTPPart.toInputStream();
    byte[] arrayOfByte = new byte[65536];
    for (int i = localInputStream.read(arrayOfByte); i > 0; i = localInputStream.read(arrayOfByte))
      localOutputStream.write(arrayOfByte, 0, i);
    localOutputStream.flush();
    localInputStream.close();
    localOutputStream.close();
    if (paramHttpResponseCallback != null);
    while (true)
    {
      try
      {
        paramHttpResponseCallback.onResponse(new HttpConnectionImpl23(localHttpURLConnection));
        localHttpURLConnection.disconnect();
        MobLog.getInstance().i("use time: " + (System.currentTimeMillis() - l), new Object[0]);
        return;
      }
      catch (Throwable localThrowable)
      {
        throw localThrowable;
      }
      finally
      {
        localHttpURLConnection.disconnect();
      }
      localHttpURLConnection.disconnect();
    }
  }

  public void httpPost(String paramString, ArrayList<KVPair<String>> paramArrayList1, ArrayList<KVPair<String>> paramArrayList2, ArrayList<KVPair<String>> paramArrayList3, HttpResponseCallback paramHttpResponseCallback, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    httpPost(paramString, paramArrayList1, paramArrayList2, paramArrayList3, 0, paramHttpResponseCallback, paramNetworkTimeOut);
  }

  public String httpPostFiles(String paramString, ArrayList<KVPair<String>> paramArrayList1, ArrayList<KVPair<String>> paramArrayList2, ArrayList<KVPair<String>> paramArrayList3, int paramInt, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    final HashMap localHashMap = new HashMap();
    httpPost(paramString, paramArrayList1, paramArrayList2, paramArrayList3, paramInt, new HttpResponseCallback()
    {
      public void onResponse(HttpConnection paramAnonymousHttpConnection)
        throws Throwable
      {
        int i = paramAnonymousHttpConnection.getResponseCode();
        if ((i == 200) || (i == 201))
        {
          StringBuilder localStringBuilder1 = new StringBuilder();
          BufferedReader localBufferedReader1 = new BufferedReader(new InputStreamReader(paramAnonymousHttpConnection.getInputStream(), Charset.forName("utf-8")));
          for (String str1 = localBufferedReader1.readLine(); str1 != null; str1 = localBufferedReader1.readLine())
          {
            if (localStringBuilder1.length() > 0)
              localStringBuilder1.append('\n');
            localStringBuilder1.append(str1);
          }
          localBufferedReader1.close();
          localHashMap.put("resp", localStringBuilder1.toString());
          return;
        }
        StringBuilder localStringBuilder2 = new StringBuilder();
        BufferedReader localBufferedReader2 = new BufferedReader(new InputStreamReader(paramAnonymousHttpConnection.getErrorStream(), Charset.forName("utf-8")));
        for (String str2 = localBufferedReader2.readLine(); str2 != null; str2 = localBufferedReader2.readLine())
        {
          if (localStringBuilder2.length() > 0)
            localStringBuilder2.append('\n');
          localStringBuilder2.append(str2);
        }
        localBufferedReader2.close();
        HashMap localHashMap = new HashMap();
        localHashMap.put("error", localStringBuilder2.toString());
        localHashMap.put("status", Integer.valueOf(i));
        throw new Throwable(new Hashon().fromHashMap(localHashMap));
      }
    }
    , paramNetworkTimeOut);
    return (String)localHashMap.get("resp");
  }

  public String httpPostFiles(String paramString, ArrayList<KVPair<String>> paramArrayList1, ArrayList<KVPair<String>> paramArrayList2, ArrayList<KVPair<String>> paramArrayList3, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    return httpPostFiles(paramString, paramArrayList1, paramArrayList2, paramArrayList3, 0, paramNetworkTimeOut);
  }

  public String httpPut(String paramString, ArrayList<KVPair<String>> paramArrayList1, KVPair<String> paramKVPair, ArrayList<KVPair<String>> paramArrayList2, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    long l = System.currentTimeMillis();
    MobLog.getInstance().i("httpPut: " + paramString, new Object[0]);
    if (paramArrayList1 != null)
    {
      String str4 = kvPairsToUrl(paramArrayList1);
      if (str4.length() > 0)
        paramString = paramString + "?" + str4;
    }
    HttpURLConnection localHttpURLConnection = getConnection(paramString, paramNetworkTimeOut);
    localHttpURLConnection.setDoOutput(true);
    localHttpURLConnection.setChunkedStreamingMode(0);
    localHttpURLConnection.setRequestMethod("PUT");
    localHttpURLConnection.setRequestProperty("Content-Type", "application/octet-stream");
    if (paramArrayList2 != null)
    {
      Iterator localIterator = paramArrayList2.iterator();
      while (localIterator.hasNext())
      {
        KVPair localKVPair = (KVPair)localIterator.next();
        localHttpURLConnection.setRequestProperty(localKVPair.name, (String)localKVPair.value);
      }
    }
    localHttpURLConnection.connect();
    OutputStream localOutputStream = localHttpURLConnection.getOutputStream();
    FilePart localFilePart = new FilePart();
    localFilePart.setFile((String)paramKVPair.value);
    InputStream localInputStream = localFilePart.toInputStream();
    byte[] arrayOfByte = new byte[65536];
    for (int i = localInputStream.read(arrayOfByte); i > 0; i = localInputStream.read(arrayOfByte))
      localOutputStream.write(arrayOfByte, 0, i);
    localOutputStream.flush();
    localInputStream.close();
    localOutputStream.close();
    int j = localHttpURLConnection.getResponseCode();
    if ((j == 200) || (j == 201))
    {
      StringBuilder localStringBuilder1 = new StringBuilder();
      BufferedReader localBufferedReader1 = new BufferedReader(new InputStreamReader(localHttpURLConnection.getInputStream(), Charset.forName("utf-8")));
      for (String str1 = localBufferedReader1.readLine(); str1 != null; str1 = localBufferedReader1.readLine())
      {
        if (localStringBuilder1.length() > 0)
          localStringBuilder1.append('\n');
        localStringBuilder1.append(str1);
      }
      localBufferedReader1.close();
      localHttpURLConnection.disconnect();
      String str2 = localStringBuilder1.toString();
      MobLog.getInstance().i("use time: " + (System.currentTimeMillis() - l), new Object[0]);
      return str2;
    }
    StringBuilder localStringBuilder2 = new StringBuilder();
    BufferedReader localBufferedReader2 = new BufferedReader(new InputStreamReader(localHttpURLConnection.getErrorStream(), Charset.forName("utf-8")));
    for (String str3 = localBufferedReader2.readLine(); str3 != null; str3 = localBufferedReader2.readLine())
    {
      if (localStringBuilder2.length() > 0)
        localStringBuilder2.append('\n');
      localStringBuilder2.append(str3);
    }
    localBufferedReader2.close();
    HashMap localHashMap = new HashMap();
    localHashMap.put("error", localStringBuilder2.toString());
    localHashMap.put("status", Integer.valueOf(j));
    throw new Throwable(new Hashon().fromHashMap(localHashMap));
  }

  public String jsonPost(String paramString, ArrayList<KVPair<String>> paramArrayList1, ArrayList<KVPair<String>> paramArrayList2, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    long l = System.currentTimeMillis();
    MobLog.getInstance().i("jsonPost: " + paramString, new Object[0]);
    HttpURLConnection localHttpURLConnection = getConnection(paramString, paramNetworkTimeOut);
    localHttpURLConnection.setDoOutput(true);
    localHttpURLConnection.setChunkedStreamingMode(0);
    localHttpURLConnection.setRequestProperty("content-type", "application/json");
    if (paramArrayList2 != null)
    {
      Iterator localIterator2 = paramArrayList2.iterator();
      while (localIterator2.hasNext())
      {
        KVPair localKVPair2 = (KVPair)localIterator2.next();
        localHttpURLConnection.setRequestProperty(localKVPair2.name, (String)localKVPair2.value);
      }
    }
    StringPart localStringPart = new StringPart();
    if (paramArrayList1 != null)
    {
      HashMap localHashMap1 = new HashMap();
      Iterator localIterator1 = paramArrayList1.iterator();
      while (localIterator1.hasNext())
      {
        KVPair localKVPair1 = (KVPair)localIterator1.next();
        localHashMap1.put(localKVPair1.name, localKVPair1.value);
      }
      localStringPart.append(new Hashon().fromHashMap(localHashMap1));
    }
    localHttpURLConnection.connect();
    OutputStream localOutputStream = localHttpURLConnection.getOutputStream();
    InputStream localInputStream = localStringPart.toInputStream();
    byte[] arrayOfByte = new byte[65536];
    for (int i = localInputStream.read(arrayOfByte); i > 0; i = localInputStream.read(arrayOfByte))
      localOutputStream.write(arrayOfByte, 0, i);
    localOutputStream.flush();
    localInputStream.close();
    localOutputStream.close();
    int j = localHttpURLConnection.getResponseCode();
    if ((j == 200) || (j == 201))
    {
      StringBuilder localStringBuilder1 = new StringBuilder();
      BufferedReader localBufferedReader1 = new BufferedReader(new InputStreamReader(localHttpURLConnection.getInputStream(), Charset.forName("utf-8")));
      for (String str1 = localBufferedReader1.readLine(); str1 != null; str1 = localBufferedReader1.readLine())
      {
        if (localStringBuilder1.length() > 0)
          localStringBuilder1.append('\n');
        localStringBuilder1.append(str1);
      }
      localBufferedReader1.close();
      localHttpURLConnection.disconnect();
      String str2 = localStringBuilder1.toString();
      MobLog.getInstance().i("use time: " + (System.currentTimeMillis() - l), new Object[0]);
      return str2;
    }
    StringBuilder localStringBuilder2 = new StringBuilder();
    BufferedReader localBufferedReader2 = new BufferedReader(new InputStreamReader(localHttpURLConnection.getErrorStream(), Charset.forName("utf-8")));
    for (String str3 = localBufferedReader2.readLine(); str3 != null; str3 = localBufferedReader2.readLine())
    {
      if (localStringBuilder2.length() > 0)
        localStringBuilder2.append('\n');
      localStringBuilder2.append(str3);
    }
    localBufferedReader2.close();
    localHttpURLConnection.disconnect();
    HashMap localHashMap2 = new HashMap();
    localHashMap2.put("error", localStringBuilder2.toString());
    localHashMap2.put("status", Integer.valueOf(j));
    throw new Throwable(new Hashon().fromHashMap(localHashMap2));
  }

  public void rawGet(String paramString, HttpResponseCallback paramHttpResponseCallback, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    long l = System.currentTimeMillis();
    MobLog.getInstance().i("rawGet: " + paramString, new Object[0]);
    HttpURLConnection localHttpURLConnection = getConnection(paramString, paramNetworkTimeOut);
    localHttpURLConnection.connect();
    if (paramHttpResponseCallback != null);
    while (true)
    {
      try
      {
        paramHttpResponseCallback.onResponse(new HttpConnectionImpl23(localHttpURLConnection));
        localHttpURLConnection.disconnect();
        MobLog.getInstance().i("use time: " + (System.currentTimeMillis() - l), new Object[0]);
        return;
      }
      catch (Throwable localThrowable)
      {
        throw localThrowable;
      }
      finally
      {
        localHttpURLConnection.disconnect();
      }
      localHttpURLConnection.disconnect();
    }
  }

  public void rawGet(String paramString, RawNetworkCallback paramRawNetworkCallback, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    rawGet(paramString, null, paramRawNetworkCallback, paramNetworkTimeOut);
  }

  public void rawGet(String paramString, ArrayList<KVPair<String>> paramArrayList, RawNetworkCallback paramRawNetworkCallback, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    long l = System.currentTimeMillis();
    MobLog.getInstance().i("rawGet: " + paramString, new Object[0]);
    HttpURLConnection localHttpURLConnection = getConnection(paramString, paramNetworkTimeOut);
    if (paramArrayList != null)
    {
      Iterator localIterator = paramArrayList.iterator();
      while (localIterator.hasNext())
      {
        KVPair localKVPair = (KVPair)localIterator.next();
        localHttpURLConnection.setRequestProperty(localKVPair.name, (String)localKVPair.value);
      }
    }
    localHttpURLConnection.connect();
    int i = localHttpURLConnection.getResponseCode();
    if (i == 200)
    {
      if (paramRawNetworkCallback != null)
        paramRawNetworkCallback.onResponse(localHttpURLConnection.getInputStream());
      localHttpURLConnection.disconnect();
      MobLog.getInstance().i("use time: " + (System.currentTimeMillis() - l), new Object[0]);
      return;
    }
    StringBuilder localStringBuilder = new StringBuilder();
    BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(localHttpURLConnection.getErrorStream(), Charset.forName("utf-8")));
    for (String str = localBufferedReader.readLine(); str != null; str = localBufferedReader.readLine())
    {
      if (localStringBuilder.length() > 0)
        localStringBuilder.append('\n');
      localStringBuilder.append(str);
    }
    localBufferedReader.close();
    localHttpURLConnection.disconnect();
    HashMap localHashMap = new HashMap();
    localHashMap.put("error", localStringBuilder.toString());
    localHashMap.put("status", Integer.valueOf(i));
    throw new Throwable(new Hashon().fromHashMap(localHashMap));
  }

  public void rawPost(String paramString, ArrayList<KVPair<String>> paramArrayList, HTTPPart paramHTTPPart, HttpResponseCallback paramHttpResponseCallback, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    long l = System.currentTimeMillis();
    MobLog.getInstance().i("rawpost: " + paramString, new Object[0]);
    HttpURLConnection localHttpURLConnection = getConnection(paramString, paramNetworkTimeOut);
    localHttpURLConnection.setDoOutput(true);
    localHttpURLConnection.setChunkedStreamingMode(0);
    if (paramArrayList != null)
    {
      Iterator localIterator = paramArrayList.iterator();
      while (localIterator.hasNext())
      {
        KVPair localKVPair = (KVPair)localIterator.next();
        localHttpURLConnection.setRequestProperty(localKVPair.name, (String)localKVPair.value);
      }
    }
    localHttpURLConnection.connect();
    OutputStream localOutputStream = localHttpURLConnection.getOutputStream();
    InputStream localInputStream = paramHTTPPart.toInputStream();
    byte[] arrayOfByte = new byte[65536];
    for (int i = localInputStream.read(arrayOfByte); i > 0; i = localInputStream.read(arrayOfByte))
      localOutputStream.write(arrayOfByte, 0, i);
    localOutputStream.flush();
    localInputStream.close();
    localOutputStream.close();
    if (paramHttpResponseCallback != null);
    while (true)
    {
      try
      {
        paramHttpResponseCallback.onResponse(new HttpConnectionImpl23(localHttpURLConnection));
        localHttpURLConnection.disconnect();
        MobLog.getInstance().i("use time: " + (System.currentTimeMillis() - l), new Object[0]);
        return;
      }
      catch (Throwable localThrowable)
      {
        throw localThrowable;
      }
      finally
      {
        localHttpURLConnection.disconnect();
      }
      localHttpURLConnection.disconnect();
    }
  }

  // ERROR //
  public void rawPost(String paramString, ArrayList<KVPair<String>> paramArrayList, HTTPPart paramHTTPPart, RawNetworkCallback paramRawNetworkCallback, NetworkTimeOut paramNetworkTimeOut)
    throws Throwable
  {
    // Byte code:
    //   0: invokestatic 291	java/lang/System:currentTimeMillis	()J
    //   3: lstore 6
    //   5: invokestatic 296	com/mob/tools/MobLog:getInstance	()Lcom/mob/tools/log/NLog;
    //   8: new 148	java/lang/StringBuilder
    //   11: dup
    //   12: invokespecial 149	java/lang/StringBuilder:<init>	()V
    //   15: ldc_w 771
    //   18: invokevirtual 155	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   21: aload_1
    //   22: invokevirtual 155	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   25: invokevirtual 156	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   28: iconst_0
    //   29: anewarray 4	java/lang/Object
    //   32: invokevirtual 304	com/mob/tools/log/NLog:i	(Ljava/lang/Object;[Ljava/lang/Object;)I
    //   35: pop
    //   36: aload_0
    //   37: aload_1
    //   38: aload 5
    //   40: invokespecial 496	com/mob/tools/network/NetworkHelper:getConnection	(Ljava/lang/String;Lcom/mob/tools/network/NetworkHelper$NetworkTimeOut;)Ljava/net/HttpURLConnection;
    //   43: astore 9
    //   45: aload 9
    //   47: iconst_1
    //   48: invokevirtual 648	java/net/HttpURLConnection:setDoOutput	(Z)V
    //   51: aload 9
    //   53: iconst_0
    //   54: invokevirtual 651	java/net/HttpURLConnection:setChunkedStreamingMode	(I)V
    //   57: aload_2
    //   58: ifnull +52 -> 110
    //   61: aload_2
    //   62: invokevirtual 172	java/util/ArrayList:iterator	()Ljava/util/Iterator;
    //   65: astore 29
    //   67: aload 29
    //   69: invokeinterface 178 1 0
    //   74: ifeq +36 -> 110
    //   77: aload 29
    //   79: invokeinterface 182 1 0
    //   84: checkcast 184	com/mob/tools/network/KVPair
    //   87: astore 30
    //   89: aload 9
    //   91: aload 30
    //   93: getfield 197	com/mob/tools/network/KVPair:name	Ljava/lang/String;
    //   96: aload 30
    //   98: getfield 203	com/mob/tools/network/KVPair:value	Ljava/lang/Object;
    //   101: checkcast 42	java/lang/String
    //   104: invokevirtual 160	java/net/HttpURLConnection:setRequestProperty	(Ljava/lang/String;Ljava/lang/String;)V
    //   107: goto -40 -> 67
    //   110: aload 9
    //   112: invokevirtual 499	java/net/HttpURLConnection:connect	()V
    //   115: aload 9
    //   117: invokevirtual 663	java/net/HttpURLConnection:getOutputStream	()Ljava/io/OutputStream;
    //   120: astore 10
    //   122: aload_3
    //   123: invokevirtual 666	com/mob/tools/network/HTTPPart:toInputStream	()Ljava/io/InputStream;
    //   126: astore 11
    //   128: ldc_w 667
    //   131: newarray byte
    //   133: astore 12
    //   135: aload 11
    //   137: aload 12
    //   139: invokevirtual 583	java/io/InputStream:read	([B)I
    //   142: istore 13
    //   144: iload 13
    //   146: ifle +25 -> 171
    //   149: aload 10
    //   151: aload 12
    //   153: iconst_0
    //   154: iload 13
    //   156: invokevirtual 670	java/io/OutputStream:write	([BII)V
    //   159: aload 11
    //   161: aload 12
    //   163: invokevirtual 583	java/io/InputStream:read	([B)I
    //   166: istore 13
    //   168: goto -24 -> 144
    //   171: aload 10
    //   173: invokevirtual 671	java/io/OutputStream:flush	()V
    //   176: aload 11
    //   178: invokevirtual 591	java/io/InputStream:close	()V
    //   181: aload 10
    //   183: invokevirtual 672	java/io/OutputStream:close	()V
    //   186: aload 9
    //   188: invokevirtual 502	java/net/HttpURLConnection:getResponseCode	()I
    //   191: istore 14
    //   193: iload 14
    //   195: sipush 200
    //   198: if_icmpne +109 -> 307
    //   201: aload 4
    //   203: ifnull +96 -> 299
    //   206: aload 9
    //   208: invokevirtual 572	java/net/HttpURLConnection:getInputStream	()Ljava/io/InputStream;
    //   211: astore 24
    //   213: aload 4
    //   215: aload 24
    //   217: invokeinterface 767 2 0
    //   222: aload 24
    //   224: ifnull +8 -> 232
    //   227: aload 24
    //   229: invokevirtual 591	java/io/InputStream:close	()V
    //   232: aload 9
    //   234: invokevirtual 555	java/net/HttpURLConnection:disconnect	()V
    //   237: invokestatic 296	com/mob/tools/MobLog:getInstance	()Lcom/mob/tools/log/NLog;
    //   240: new 148	java/lang/StringBuilder
    //   243: dup
    //   244: invokespecial 149	java/lang/StringBuilder:<init>	()V
    //   247: ldc_w 456
    //   250: invokevirtual 155	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   253: invokestatic 291	java/lang/System:currentTimeMillis	()J
    //   256: lload 6
    //   258: lsub
    //   259: invokevirtual 459	java/lang/StringBuilder:append	(J)Ljava/lang/StringBuilder;
    //   262: invokevirtual 156	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   265: iconst_0
    //   266: anewarray 4	java/lang/Object
    //   269: invokevirtual 304	com/mob/tools/log/NLog:i	(Ljava/lang/Object;[Ljava/lang/Object;)I
    //   272: pop
    //   273: return
    //   274: astore 27
    //   276: aload 27
    //   278: athrow
    //   279: astore 25
    //   281: aload 24
    //   283: ifnull +8 -> 291
    //   286: aload 24
    //   288: invokevirtual 591	java/io/InputStream:close	()V
    //   291: aload 9
    //   293: invokevirtual 555	java/net/HttpURLConnection:disconnect	()V
    //   296: aload 25
    //   298: athrow
    //   299: aload 9
    //   301: invokevirtual 555	java/net/HttpURLConnection:disconnect	()V
    //   304: goto -67 -> 237
    //   307: new 148	java/lang/StringBuilder
    //   310: dup
    //   311: invokespecial 149	java/lang/StringBuilder:<init>	()V
    //   314: astore 15
    //   316: new 594	java/io/BufferedReader
    //   319: dup
    //   320: new 596	java/io/InputStreamReader
    //   323: dup
    //   324: aload 9
    //   326: invokevirtual 599	java/net/HttpURLConnection:getErrorStream	()Ljava/io/InputStream;
    //   329: ldc_w 462
    //   332: invokestatic 605	java/nio/charset/Charset:forName	(Ljava/lang/String;)Ljava/nio/charset/Charset;
    //   335: invokespecial 608	java/io/InputStreamReader:<init>	(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
    //   338: invokespecial 611	java/io/BufferedReader:<init>	(Ljava/io/Reader;)V
    //   341: astore 16
    //   343: aload 16
    //   345: invokevirtual 614	java/io/BufferedReader:readLine	()Ljava/lang/String;
    //   348: astore 17
    //   350: aload 17
    //   352: ifnull +37 -> 389
    //   355: aload 15
    //   357: invokevirtual 468	java/lang/StringBuilder:length	()I
    //   360: ifle +11 -> 371
    //   363: aload 15
    //   365: bipush 10
    //   367: invokevirtual 471	java/lang/StringBuilder:append	(C)Ljava/lang/StringBuilder;
    //   370: pop
    //   371: aload 15
    //   373: aload 17
    //   375: invokevirtual 155	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   378: pop
    //   379: aload 16
    //   381: invokevirtual 614	java/io/BufferedReader:readLine	()Ljava/lang/String;
    //   384: astore 17
    //   386: goto -36 -> 350
    //   389: aload 16
    //   391: invokevirtual 615	java/io/BufferedReader:close	()V
    //   394: aload 9
    //   396: invokevirtual 555	java/net/HttpURLConnection:disconnect	()V
    //   399: new 617	java/util/HashMap
    //   402: dup
    //   403: invokespecial 618	java/util/HashMap:<init>	()V
    //   406: astore 18
    //   408: aload 18
    //   410: ldc_w 620
    //   413: aload 15
    //   415: invokevirtual 156	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   418: invokevirtual 624	java/util/HashMap:put	(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    //   421: pop
    //   422: aload 18
    //   424: ldc_w 626
    //   427: iload 14
    //   429: invokestatic 632	java/lang/Integer:valueOf	(I)Ljava/lang/Integer;
    //   432: invokevirtual 624	java/util/HashMap:put	(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    //   435: pop
    //   436: new 15	java/lang/Throwable
    //   439: dup
    //   440: new 634	com/mob/tools/utils/Hashon
    //   443: dup
    //   444: invokespecial 635	com/mob/tools/utils/Hashon:<init>	()V
    //   447: aload 18
    //   449: invokevirtual 639	com/mob/tools/utils/Hashon:fromHashMap	(Ljava/util/HashMap;)Ljava/lang/String;
    //   452: invokespecial 640	java/lang/Throwable:<init>	(Ljava/lang/String;)V
    //   455: athrow
    //   456: astore 28
    //   458: goto -226 -> 232
    //   461: astore 26
    //   463: goto -172 -> 291
    //
    // Exception table:
    //   from	to	target	type
    //   213	222	274	java/lang/Throwable
    //   213	222	279	finally
    //   276	279	279	finally
    //   227	232	456	java/lang/Throwable
    //   286	291	461	java/lang/Throwable
  }

  public static class NetworkTimeOut
  {
    public int connectionTimeout;
    public int readTimout;
  }

  public static final class SimpleX509TrustManager
    implements X509TrustManager
  {
    private X509TrustManager standardTrustManager;

    public SimpleX509TrustManager(KeyStore paramKeyStore)
    {
      TrustManager[] arrayOfTrustManager;
      try
      {
        TrustManagerFactory localTrustManagerFactory = TrustManagerFactory.getInstance("X509");
        localTrustManagerFactory.init(paramKeyStore);
        arrayOfTrustManager = localTrustManagerFactory.getTrustManagers();
        if ((arrayOfTrustManager == null) || (arrayOfTrustManager.length == 0))
          throw new NoSuchAlgorithmException("no trust manager found.");
      }
      catch (Exception localException)
      {
        MobLog.getInstance().d("failed to initialize the standard trust manager: " + localException.getMessage(), new Object[0]);
        this.standardTrustManager = null;
        return;
      }
      this.standardTrustManager = ((X509TrustManager)arrayOfTrustManager[0]);
    }

    public void checkClientTrusted(X509Certificate[] paramArrayOfX509Certificate, String paramString)
      throws CertificateException
    {
    }

    public void checkServerTrusted(X509Certificate[] paramArrayOfX509Certificate, String paramString)
      throws CertificateException
    {
      if (paramArrayOfX509Certificate == null)
        throw new IllegalArgumentException("there were no certificates.");
      if (paramArrayOfX509Certificate.length == 1)
      {
        paramArrayOfX509Certificate[0].checkValidity();
        return;
      }
      if (this.standardTrustManager != null)
      {
        this.standardTrustManager.checkServerTrusted(paramArrayOfX509Certificate, paramString);
        return;
      }
      throw new CertificateException("there were one more certificates but no trust manager found.");
    }

    public X509Certificate[] getAcceptedIssuers()
    {
      return new X509Certificate[0];
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.mob.tools.network.NetworkHelper
 * JD-Core Version:    0.6.2
 */